package com.tsing.common.exceptions;

public interface ServerException {

    final int PROXYERR = 800;

    enum Proxy implements ExceptionType {
        USERNAME_FAILURE(PROXYERR + 1, "手机号错误"),
        PASSWORD_FAILURE(PROXYERR + 2, "密码错误"),
        ACCOUNT_LIMIT_LOGIN(PROXYERR + 3, "账号被限制登录，请15分钟后重试"),
        USERNAME_IS_NOTNULL(4, "手机号已存在"),
        PASSWORD_VERIFY_FAILURE(PROXYERR + 5, "密码验证失败"),
        PLEASE_PLAY_PASSWORD_VERIFY(PROXYERR + 6, "请先进行密码验证"),
        ROLENAME_IS_NOTNULL(7, "角色名称已存在"),
        ROLE_HAVE_RELEVANCE(8, "角色存在绑定的用户，不允许被删除"),
        PERMISSIONURL_IS_NOTNULL(9, "url已存在"),
        PERMISSION_HAVE_RELEVANCE(10, "权限存在绑定的角色，不允许被删除"),
        NAME_HAVE_RELEVANCE(11, "名称已经存在"),
        BUILDING_HAVE_RELEVANCE(12, "楼栋下关联有单元，不允许被删除"),
        UNIT_HAVE_RELEVANCE(13, "单元下关联有房屋，不允许被删除"),
        HOUSE_HAVE_RELEVANCE(14, "房屋已被用户关联，不允许被删除"),
        DEPOT_HAVE_RELEVANCE(15, "停车场下关联有停车位，不允许被删除"),
        CARPORT_HAVE_RELEVANCE(16, "停车位已被用户关联，不允许被删除"),
        MAINTAIN_HAVE_RELEVANCE(17, "报修类型已被报修单关联，不允许被删除"),
        WECHAT_SERVER_EXCEPTION(18, "无法获取微信openid"),
        USER_NOT_EXIST(20, "用户不存在，请先注册"),


        ;

        private int code;
        private String description;

        private Proxy(int code, String description) {
            this.code = code;
            this.description = description;
        }

        @Override
        public int getCode() {
            return this.code;
        }

        @Override
        public String getDescription() {
            return this.description;
        }
    }

}